
#ifndef __WeatherView__View__
#define __WeatherView__View__

#include "RootWindow.h"


struct WeatherDayData
{
	std::string szWeek;
	std::string szDayweather;
	std::string szDayTemperature;
};

struct WeatherData
{
	std::string szCityName;
	std::string szWeather;
	std::string szTemperature;
	std::string szWindpower;
	std::string szHumidity;
	std::string szTodayDate;
	std::string szTodayTemperature;
	std::vector<WeatherDayData> vDayWeathers;
	std::string szWinddirection;
};

typedef struct _ForecastsData
{
	CALabel* dateLabel;
	CALabel* wdLabel;
	CAImageView* dImage;
} ForecastsData;

class CWeatherView : public CAScrollView
{
    
public:

	CWeatherView();
    
	virtual ~CWeatherView();
    
	static CWeatherView* create();

	void setDatas(const WeatherData& d);

	void setWeatherDetailFirstResponder(bool v);

protected:

	bool init();

	void addNewCastView(int index);

	void addTodayLivesWeather();

	CALabel* createLivesLabel(int h, const std::string& szName, const std::string& szValue);

	std::string getWeatherIconPath(const std::string& szWeather);

private:
	CALabel* m_pCityLabel;
	CALabel* m_pWDLabel;
	CALabel* m_pWeatherLabel;
	CALabel* m_pSDLabel;
	CALabel* m_pFLLabel;
	CALabel* m_pTodayLabel;
	CALabel* m_pTodayWDLabel;
	CAScrollView* m_pWeatherDetailView;
	int m_iTodayWeatherHeight;

	CALabel* m_pLivesTQLabel;
	CALabel* m_pLivesWDLabel;
	CALabel* m_pLivesFXLabel;
	CALabel* m_pLivesFLLabel;
	CALabel* m_pLivesSDLabel;

	std::vector<ForecastsData> m_vForcastsLabels;
};


#endif
